package cn.bjxy.shishaolong.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author 时少龙
 * @since 2019-03-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_resources")
public class Resources implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "tid", type = IdType.AUTO)
    private Integer tid;

    /**
     * 键值
     */
    private String key;

    /**
     * 资源名称
     */
    private String name;

    /**
     * 资源路径
     */
    private String path;

    /**
     * 上级ID
     */
    private Integer pid;

    /**
     * 类型：menu 菜单；func 功能
     */
    private String type;

    /**
     * 层级
     */
    private String level;

    /**
     * 是否可见，1 可见；0 不可见；
     */
    private Integer visiable;

    /**
     * 排序号
     */
    private Integer seq;

    /*===========================查询字段===============================*/
    @TableField(exist = false)
    private List<Resources> children;

    @TableField(exist = false)
    private Boolean checked;

    @TableField(exist = false)
    private Boolean expand;

    // 为了适应菜单属性
    public String getTitle(){
        return name;
    }
}
